function loading(urll,obj_level){
	$($('.loading')[parseInt(obj_level)]).fadeIn(500);
	$($('.p'+(parseInt(obj_level)+1))[0]).fadeOut(500,function(){
		turn(urll,obj_level);
	});
}

function turn(urll,obj_level){
	
	$.ajax({
		type: 'get',
		url: urll,
		beforeSend: function(XMLHttpRequest){
			//ShowLoading();
		},
		success: function(data, textStatus){
			$($('.scroll')[parseInt(obj_level)]).find('ul').html(data);
			$($('.left_button')[parseInt(obj_level)]).unbind();
			$($('.right_button')[parseInt(obj_level)]).unbind();
			var size = $($('.scroll')[parseInt(obj_level)]).find('li').length;
			
			if(size<=2){
				$($('.scroll')[parseInt(obj_level)]).unbind().find('ul').css('left',0);
				$($('.left_button')[parseInt(obj_level)]).css('display','none');
				$($('.right_button')[parseInt(obj_level)]).css('display','none');
			}else{
				$($('.left_button')[parseInt(obj_level)]).css('display','block');
				$($('.right_button')[parseInt(obj_level)]).css('display','block');
				$($('.scroll')[parseInt(obj_level)]).unbind().jCarouselLite({
					btnNext: $('.left_button')[parseInt(obj_level)],
					btnPrev: $('.right_button')[parseInt(obj_level)]
				});
			}
			
			if(size==0){
				$($('.scroll')[parseInt(obj_level)]).unbind().find('ul').css('left',0).html('<li>暂时没有商品</li>');
			}
			
			
			
			$($('.loading')[parseInt(obj_level)]).fadeOut(500);
			$($('.p'+(parseInt(obj_level)+1))[0]).fadeIn(500);
		},
		
		complete: function(XMLHttpRequest, textStatus){
			//HideLoading();
		},
		error: function(){
			turn(urll,me);
		}
	});

}


